/**
 * 
 */
package com.xinpark.webapps.sf.web.module.screen;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.citrus.turbine.Context;
import com.alibaba.citrus.turbine.TurbineRunData;
import com.xinpark.shared.ServiceException;
import com.xinpark.shared.service.ShopService;
import com.xinpark.shared.service.model.ShopModel;
import com.xinpark.shared.service.param.QueryShopParam;

/**
 * The screen code for template "shopCreate.vm"
 * @author Jianliang Chen 2013-02-12 17:00:00
 *
 */
public class ShopCreate {
	@Autowired  
    private ShopService shopService;

	public void execute(Context context, TurbineRunData rundata) {
		QueryShopParam queryParam = new QueryShopParam();
		
		try{
			String shopId = rundata.getParameters().getString("shopId");
			
			if( shopId != null) {
				queryParam.setShopId(shopId);
				ShopModel shop = shopService.getShop(queryParam);
				context.put("shop", shop);
			}
		} catch (ServiceException se) {
			se.printStackTrace();
		}
	}
	
}
